<!doctype html>
<html>

<head>
    <meta charset="utf-8">
    <title>借助absolute把Footer固定在页面底部</title>
    <style>
        * {
            margin: 0px;
            padding: 0px;
        }

        html,
        body {
            width: 100%;
            height: 100%;
        }

        .main {
            position: relative;
            min-height: 100%;
        }

        header {
            width: 100%;
            position: sticky;
            top: 0;
            background-color: #0b84fd;
            padding: 20px 0px;
            text-align: center;
        }

        .content {
            /*高度可由内容撑开*/
            width: 100%;
        }

        footer {
            position: absolute;
            bottom: 0;
            width: 100%;
            height: 50px;
            line-height: 50px;
            text-align: center;
            background-color: #666;
        }
    </style>
</head>

<body>
    <div class="main">
        <header>header</header>
        <div class="content">
            content
        </div>
        <footer>2011-2019 © bajins.com</footer>
    </div>
</body>

</html>